package com.things;

import java.io.*;

public class Thing {
	public static char[] board;
	public static BufferedReader br;
	
	public static void main(String[] args) 
	throws IOException {
		br = new BufferedReader(new InputStreamReader(System.in));
		
		//Declare local variables
		String player1Name;
		String player2Name;
		int Move;
		int whoseTurn = 1;
		int movesLeft = 9;
		board = new char[9];
		
		//Get player names
		player1Name = "Nick";
		player2Name = "John";
		
		//Initialize board
		board[0] = '0';
		board[1] = '1';
		board[2] = '2';
		board[3] = '3';
		board[4] = '4';
		board[5] = '5';
		board[6] = '6';
		board[7] = '7';
		board[8] = '8';
		
		showBoard();
		
		while(whoWon() == 0 && movesLeft > 0) {
			switch(whoseTurn) {
				case(1): {
					br.readLine();
				}
			}
		}
	}
	
	public static void showBoard() {
		System.out.println(" " + board[0] + " | " + board[1] + " | " + board[2] + " ");
		System.out.println("---+---+---");
		System.out.println(" " + board[3] + " | " + board[4] + " | " + board[5] + " ");
		System.out.println("---+---+---");
		System.out.println(" " + board[6] + " | " + board[7] + " | " + board[8] + " ");
		System.out.println();
	}
	
	public static boolean isValidMove(int playerMove) {
		if(!(board[playerMove] == 'x') && !(board[playerMove] == 'o'))
			return true;
		else
			return false;
	}
	
	public static int whoWon() {
		int result = 0;
		if(board[0] == 'x' && board[1] == 'x' && board[2] == 'x')
			result = 1;
		if(board[0] == 'o' && board[1] == 'o' && board[2] == 'o')
			result = 2;
	}
}
